import { Shape } from '@antv/x6'

export function createRect(graph, options) {
    
    var ports = {
        groups: {
            group1: {
                attrs: {
                    circle: {
                        magnet: true,
                        r: 4,
                        fill: '#fff',
                    }
                },
                position: 'top',
            },
            group2: {
                attrs: {
                    circle: {
                        magnet: true,
                        r: 4,
                        fill: '#fff',
                    }
                },
                position: 'right',
            },
            group3: {
                attrs: {
                    circle: {
                        magnet: true,
                        r: 4,
                        fill: '#fff',
                    }
                },
                position: 'bottom',
            },
            group4: {
                attrs: {
                    circle: {
                        magnet: true,
                        r: 4,
                        fill: '#fff',
                    }
                },
                position: 'left',
            }
            
        },
        items: [{
            id: 'port1',
            group: 'group1',
            
        }, {
            id: 'port2',
            group: 'group2',
        }, {
            id: 'port3',
            group: 'group3',
        }, {
            id: 'port4',
            group: 'group4',
        }]
    }
    var rect = new Shape.Rect({
        id: options.id,
        x: 0,
        y: 0,
        width: 100,
        height: 50,
        label: options.label,
        ports,
        data:{
            bpmnType:'rect'
        }
    })




    return rect

}
